from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
from typing import Optional
from module_admin.annotation.pydantic_annotation import as_query




class JkyxModel(BaseModel):
    """
    监控影像处理记录表对应pydantic模型
    """
    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)

    id: Optional[int] = Field(default=None, description='主键')
    user_id: Optional[int] = Field(default=None, description='用户id')
    type: Optional[int] = Field(default=None, description='处理类型：1去除雨雾雪 2xx')
    file_path: Optional[str] = Field(default=None, description='文件路径')
    result_path: Optional[str] = Field(default=None, description='结果路径')
    create_time: Optional[datetime] = Field(default=None, description='创建时间')
    user_name: Optional[str] = Field(default=None, description='用户名')






class JkyxQueryModel(JkyxModel):
    """
    监控影像处理记录不分页查询模型
    """
    pass


@as_query
class JkyxPageQueryModel(JkyxQueryModel):
    """
    监控影像处理记录分页查询模型
    """

    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=10, description='每页记录数')


class DeleteJkyxModel(BaseModel):
    """
    删除监控影像处理记录模型
    """

    model_config = ConfigDict(alias_generator=to_camel)

    ids: str = Field(description='需要删除的主键')
